package com.zcx.qshop.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.animation.ScaleAnimation;
import android.widget.ImageView;

import com.zcx.qshop.R;

/**
 * Created by Administrator on 2015/9/25 0025.
 */
public class LoadBackgoundView extends ImageView {

    private ScaleAnimation scaleAnimation;

    public LoadBackgoundView(Context context, AttributeSet attrs) {

        super(context, attrs);

        setBackgroundResource(R.mipmap.load_background);

        scaleAnimation = new ScaleAnimation(1.0f, 0.9f, 1.0f, 0.9f, 50, 50);

        scaleAnimation.setDuration(1500);

        scaleAnimation.setFillAfter(true);

    }

    public void startNow(){

        setAnimation(scaleAnimation);

        scaleAnimation.startNow();

    }

    public void cancel(){

        scaleAnimation.cancel();

    }

}
